<template>
  <van-list v-model:loading="loading" :finished="finished" finished-text="没有更多了" @load="onLoad">
    <div class="singer-item" v-for="(item, index) in singerData" :key="index">
      <div class="avatar">
        <van-image width="60" height="60" :src="item.img1v1Url" />
      </div>
      <div class="singer-info">
        <p>{{ item.name }}</p>
        <span>{{ item.fansCount }}</span>
      </div>
    </div>
  </van-list>
</template>

<script>
import { artists, artistsSongs } from '@/api/singerApi.js'
export default {
  data() {
    return {
      singerData: [],
      etArtistsPar: {
        limit: 50,
      },
    }
  },
  created() {
    this.getArtists()
  },
  methods: {
    getArtists() {
      artists(this.etArtistsPar).then((res) => {
        if (res.data.code != 200) return
        this.singerData = res.data.artists
        // console.log(res)
      })
    },
  },
}
</script>

<style lang="less" scoped>
.van-list {
  padding-bottom: 2rem;
}
.singer-item {
  width: 100%;
  height: 2rem;
  padding: 0 15px;
  border-bottom: #dcdfe6 solid 1px;
  border-top: #dcdfe6 solid 1px;
  display: flex;
  align-items: center;
  .avatar {
    flex: 1;
    .van-image {
      border-radius: 50%;
      overflow: hidden;
    }
  }
  .singer-info {
    flex: 4;
    p {
      font-size: 16px;
      margin-bottom: 6px;
    }
    span {
      color: #909399;
    }
  }
}
</style>